1. /* siosior.cpp by K.Tsuru */
  2. // function ID = 409 BRADIX
  3. /***************************************
  4. SInteger class
  5. It provides the bit "or" operation m|n.
  6. ****************************************/
  7. #ifndef SN_H
  8. #include "sn.h"
  9. #endif
  10. SInteger operator|(const SInteger& m, const SInteger& n){
  11. if(m.Sign(409) == 0) return n;
  12. if(n.Sign(409) == 0) return m;
  13. const fType* mv;
  14. const fType* nv;
  15. uint t, h;
  16. mv = m.ReadFigures();
  17. nv = n.ReadFigures();
  18. h = max(m.Head(), n.Head()); // aHead --> Head() since ver 2.191
  19. t = min(m.Tail(), n.Tail());
  20. SInteger result;
  21. result.valloc(h+1u, -1);
  22. result.figure.clear(0, t);
  23. result.figure.clear(h+1u);
  24. fType* rv = result.figure.Elements();
  25. for(register uint i = t; i<= h; i++){
  26. rv[i] = mv[i] | nv[i];
  27. }
  28. result.aTail = t;
  29. result.aHead = h;
  30. result.SetSign(1); //It always attaches the positive sign.
  31. return result;
  32. }

siosior.cpp : last modifiled at 2017/03/13 14:32:00(908 bytes)
created at 2016/04/25 14:53:17
The creation time of this html file is 2017/10/25 11:09:45 (Wed Oct 25 11:09:45 2017).